<template>
  <el-row>
    <el-col :span="24">
      <el-card>
        <div class="info">
          <h1>个人信息显示页面</h1>
          <el-collapse accordion>
            <el-collapse-item disabled>
              <template slot="title">
                <i class="header-icon el-icon-info" />
                <span>工号</span>
                <span style="margin-left:100px">{{ teacher.tno }}</span>
              </template>
              <!-- <div>{{ teacher.tno }}</div>
              <el-divider />
              <el-row :gutter="20">
                <el-col :span="6" style="height:40px;line-height: 40px;">
                  <el-checkbox v-model="checkInfo.tno">确认修改</el-checkbox>
                </el-col>
                <el-col :span="6">
                  <el-input
                    v-model="info.tno"
                    :disabled="checkInfo.tno"
                    placeholder="请输入内容"
                    clearable
                  />
                </el-col>
              </el-row> -->
            </el-collapse-item>
            <el-collapse-item>
              <template slot="title">
                <i class="header-icon el-icon-info" />
                <span>姓名</span>
                <span style="margin-left:100px" :class="{checked:checkInfo.tname}">{{ teacher.tname }}</span>
              </template>
              <div>{{ info.tname }}</div>
              <el-divider />
              <el-row :gutter="20">
                <el-col :span="6" style="height:40px;line-height: 40px;">
                  <el-checkbox v-model="checkInfo.tname">确认修改</el-checkbox>
                </el-col>
                <el-col :span="6">
                  <el-input
                    v-model="info.tname"
                    :disabled="checkInfo.tname"
                    placeholder="请输入内容"
                    clearable
                  />
                </el-col>
              </el-row>
            </el-collapse-item>
            <el-collapse-item>
              <template slot="title">
                <i class="header-icon el-icon-info" />
                <span>性别</span>
                <span style="margin-left:100px" :class="{checked:checkInfo.sex}">{{ teacher.sex }}</span>
              </template>
              <div>{{ info.sex }}</div>
              <el-divider />
              <el-row :gutter="20">
                <el-col :span="6" style="height:40px;line-height: 40px;">
                  <el-checkbox v-model="checkInfo.sex">确认修改</el-checkbox>
                </el-col>
                <el-col :span="6">
                  <el-select v-model="info.sex" :disabled="checkInfo.sex" filterable placeholder="请选择">
                    <el-option
                      v-for="item in sexList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-col>
              </el-row>
            </el-collapse-item>
            <el-collapse-item disabled>
              <template slot="title">
                <i class="header-icon el-icon-info" />
                <span>职称</span>
                <span style="margin-left:100px">{{ teacher.title }}</span>
              </template>
              <!-- <div>{{ teacher.title }}</div>
              <el-divider />
              <el-row :gutter="20">
                <el-col :span="6" style="height:40px;line-height: 40px;">
                  <el-checkbox v-model="checkInfo.title">确认修改</el-checkbox>
                </el-col>
                <el-col :span="6">
                  <el-select v-model="info.title" :disabled="checkInfo.title" filterable placeholder="请选择">
                    <el-option
                      v-for="item in titleList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-col>
              </el-row> -->
            </el-collapse-item>
            <el-collapse-item disabled>
              <template slot="title">
                <i class="header-icon el-icon-info" />
                <span>院系</span>
                <span style="margin-left:100px">{{ teacher.dname }}</span>
              </template>
              <!-- <div>{{ teacher.dname }}</div>
              <el-divider />
              <el-row :gutter="20">
                <el-col :span="6" style="height:40px;line-height: 40px;">
                  <el-checkbox v-model="checkInfo.dname">确认修改</el-checkbox>
                </el-col>
                <el-col :span="6">
                  <el-input
                    v-model="info.dname"
                    :disabled="checkInfo.dname"
                    placeholder="请输入内容"
                    clearable
                  />
                </el-col>
              </el-row> -->
            </el-collapse-item>
            <el-collapse-item>
              <template slot="title">
                <i class="header-icon el-icon-info" />
                <span>密码</span>
                <span style="margin-left:100px"><input class="text_pwd" :class="{checked:checkInfo.tpwd}" type="password" :value="teacher.tpwd" readonly></span>
              </template>
              <div><input class="text_pwd" type="password" :value="info.tpwd" readonly></div>
              <el-divider />
              <el-row :gutter="20">
                <el-col :span="6" style="height:40px;line-height: 40px;">
                  <el-checkbox v-model="checkInfo.tpwd">确认修改</el-checkbox>
                </el-col>
                <el-col :span="6">
                  <el-input
                    v-model="info.tpwd"
                    :disabled="checkInfo.tpwd"
                    placeholder="请输入内容"
                    type="password"
                    clearable
                  />
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-collapse>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>
<script>
export default {
  data() {
    return {
      teacher: {
        tno: '2018cz123',
        tname: '张三',
        sex: '男',
        title: '讲师',
        dname: '数学与计算机学院',
        tpwd: '123'
      },
      info: {
        tno: '2018cz123',
        tname: '张三',
        sex: '男',
        title: '讲师',
        dname: '数学与计算机学院',
        tpwd: '123'
      },
      checkInfo: {
        tno: false,
        tname: false,
        sex: false,
        title: false,
        dname: false,
        tpwd: false
      },
      sexList: [
        {
          value: '男',
          label: '男'
        },
        {
          value: '女',
          label: '女'
        }
      ],
      titleList: [
        {
          value: '1',
          label: '讲师'
        },
        {
          value: '0',
          label: '高级讲师'
        },
        {
          value: '2',
          label: '助教'
        }
      ]
    }
  }
}
</script>
<style lang="scss" scoped>
  .info {
    margin:0 auto;
    text-align: center;
  }
  .checked {
    color: red;
  }
  .text_pwd {
    border: 0px;
    outline: 0px;
  }
</style>
